package com.xiaoshuidi.cloud.module.iot.uitils;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

/**
 * @author Sky
 * create 2020/05/09
 * email sky.li@ixiaoshuidi.com
 **/
public class GuoJiaUtils {

    public static final String defaultVersion = "1.0";

    /**
     * 生成果加请求头数据(除登录外)
     *
     * @param token
     * @return
     */
    public static Map<String, String> generateHeader(String token) {
        return generateHeader(defaultVersion, token);
    }


    /**
     * 生成果加请求头数据(除登录外)
     *
     * @param version
     * @param token
     * @return
     */
    public static Map<String, String> generateHeader(String version, String token) {
        Map<String, String> header = new HashMap<>();
        header.put("version", version);
        header.put("access_token", token);
        header.put("s_id", UUID.randomUUID().toString());
        return header;
    }

    /**
     * 生成果加登录请求头
     *
     * @return
     */
    public static Map<String, String> generateLoginHeader() {
        Map<String, String> header = new HashMap<>();
        header.put("version", defaultVersion);
        header.put("s_id", UUID.randomUUID().toString());
        return header;
    }

}
